package com.project.class4_8.proxy.service.impl;

import com.project.class4_8.proxy.dao.IRoomDao;
import com.project.class4_8.proxy.dao.IUserDao;
import com.project.class4_8.proxy.dao.impl.RoomDaoImpl;
import com.project.class4_8.proxy.service.IUserService;
import com.project.class4_8.proxy.util.Auto;
import com.project.class4_8.proxy.util.ServiceProxy;

public class UserServiceImpl implements IUserService {
    @Auto
    private IUserDao dao;
    @Auto
    private IRoomDao roomDao;
    @Override
    public void eat() {
         dao.eat();
        System.out.println(roomDao.findInfo());
    }

    public static void main(String[] args) {
        ServiceProxy serviceProxy=new ServiceProxy(new UserServiceImpl());
        IUserService service=(IUserService) serviceProxy.getProxy();
        service.eat();

    }
}
